package com.xyd.entity;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.io.Serializable;

@Component
public class User implements Serializable {

    private int userid;
    private String name;
    private String pwd;

    public User() {
    }

    public User(String name, String pwd) {
        this.name = name;
        this.pwd = pwd;
    }

    public String intro() {
        return "我是：" + name + ",密码是：" + pwd;

    }


    @PostConstruct
    public void init() {
        System.out.println("初始化之后执行");
    }

    @PreDestroy
    public void des() {
        System.out.println("销毁之前");
    }

    public int getUserid() {
        return userid;
    }

    public void setUserid(int userid) {
        this.userid = userid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }
}
